﻿using CleanArchitecture.Infrastructure.Models.Business.Advertises;
using CleanArchitecture.Infrastructure.Models.Business.Blog;
using CleanArchitecture.Infrastructure.Models.Business.Columns;
using CleanArchitecture.Infrastructure.Models.Business.Comments;
using CleanArchitecture.Infrastructure.Models.Business.FileUpload;
using CleanArchitecture.Infrastructure.Models.Business.News;
using System.Collections.Generic;

namespace CleanArchitecture.Web.Factories
{
    public partial interface IBusinessModelFactory
    {
        #region Column
        IList<ColumnTreeItemModel> PrepareColumnItemTreeModel(int LanguageId = 0, int columntype = 0, bool layout = false);
        IList<ColumnTreeItemModel> PrepareAuthorizedColumnItemTreeModel(int[] roleIds, int LanguageId = 0, int columntype = 0);
        ColumnItemModel PrepareColumnItemModel(int cid = 0);
        /// <summary>
        /// 前端接口调用，用于过滤有菜单栏目是否在前端不显示
        /// </summary>
        /// <param name="LangugeId"></param>
        /// <returns></returns>
        IList<ColumnItemModel> PrepareColumnItemModelsForFront(int LangugeId);

        IList<ColumnItemModel> GetColumnBreadcrumb(int cid);

        bool ColumnHasChild(int cid);
        #endregion

        #region News
        /// <summary>
        /// Prepare paged news item list model
        /// </summary>
        /// <param name="keepContents">默认:false,是否保留列表文章</param>
        /// <returns>News item list model</returns>
        NewsItemListModel PrepareNewsItemListModel(NewsItemSearchModel searchModel, bool keepContents = false);

        NewsItemModel PrepareNewsItemModel(int newsItemId = 0);
        /// <summary>
        /// 前端展示页面根据栏目菜单Id获取每个栏目下前N条文章信息
        /// 与PrepareNewsItemByColumnIdsForFront区别在于：
        /// PrepareNewsItemByColumnIdsForFront 只获取发布日期最新的前N条记录
        /// PrepareNewsItemByEachColumnIdForFront 首先获取每个栏目下推荐置顶的前N条记录
        /// 当推荐置顶记录不够前N条时，获取最新发布的记录补足
        /// </summary>
        /// <param name="columnIds"></param>
        /// <param name="topN"></param>
        /// <param name="keepContents"></param>
        /// <returns></returns>
        IDictionary<int, List<NewsItemModel>> PrepareNewsItemByEachColumnIdForFront(int[] columnIds, int topN = 1, bool keepContents = false);
        /// <summary>
        /// 前端展示页面根据栏目菜单Id获取每个栏目下前N条文章信息
        /// </summary>
        /// <param name="columnIds">Arrays of Column Id</param>
        /// <param name="topN">Number of NewsItem of each group column, Default: 1</param>
        /// <param name="keepContents">Is Contain Contents of NewsItem</param>
        IList<NewsItemModel> PrepareNewsItemByColumnIdsForFront(int[] columnIds, int topN = 1, bool keepContents = false);
        /// <summary>
        /// 前端页面根据栏目Id获取其对应的文章内容
        /// 适用于栏目为单页内容展示
        /// </summary>
        /// <param name="columnId"></param>
        /// <returns></returns>
        NewsItemModel PrepareColumnNewsItemModelForFront(int columnId);
        /// <summary>
        /// 前端页面具体文章信息获取
        /// 与PrepareNewsItemModel方法区别在于封装了对于页面展示所需要的额外信息
        /// </summary>
        /// <param name="newsItemId"></param>
        /// <returns></returns>
        NewsItemModel PrepareNewsItemModelForFront(int newsItemId);
        #endregion

        #region Blog
        /// <summary>
        /// Prepare paged news item list model
        /// </summary>
        /// <returns>News item list model</returns>
        BlogItemListModel PrepareBlogItemListModel(BlogItemSearchModel searchModel);
        /// <summary>
        /// 前后台公用获取博客详情数据，前端访问页面时记录用户浏览博客行为日志，后台系统则不用记录
        /// </summary>
        /// <param name="blogItemId"></param>
        /// <param name="logvisitActivity"></param>
        /// <returns></returns>
        BlogItemModel PrepareBlogItemModel(int blogItemId = 0, bool logvisitActivity = false);
        /// <summary>
        /// 当导航栏目菜单为单页详情页面时，返回栏目对应的博文详情
        /// </summary>
        /// <param name="columnid"></param>
        /// <param name="logvisitActivity">是否记录浏览博客日志</param>
        /// <returns></returns>
        BlogItemModel GetBlogItemModelForSinglePageColumn(int columnid, bool logvisitActivity = false);
        #endregion

        #region Resourcemanage
        FileItemListModel PrepareFileItemListModel(FileItemSearchModel searchModel);
        FileItemModel PrepareFileItemModel(int fileid);
        #endregion

        #region AdvertiseManager
        AdvertiseBannerListModel PrepareAdvertiseBannerListModel(AdvertiseBannerSearchModel searchModel);
        AdvertiseBannerModel PrepareAdvertiseBannerModel(int entityId);
        #endregion

        #region Comment
        CommentListModel PrepareCommentListModel(CommentSearchModel searchModel);
        #endregion
    }

}
